Content-Based Design and Implementation of Ambient Intelligence Applications