Design and Implementation of a Socially-Enhanced Pervasive Middleware