Refactor Factory out of Controller package.

Refs #32
Merge branch 'master' of https://github.com/joomla/joomla-framework