It's already done. This is how these "website builders" (e.g. Wix) works - your put different modules onto a template and build your site out of these.
Also Drupal and Wordpress have similar funcionality via plugins.
Right, but I wasn't talking about website builders. I'm talking about enabling access to a phone's various sensors and capabilities through a manner similar to Pockit.