Merge pull request #4 from Demestotenes/code-structure

Code structure: moving parts of factory to extensions
fix register extension on app object