The Changing Role of Pervasive Middleware: from Discovery and Orchestration to Recommendation and Planning