Code restructure

Re-organised structure of code so that core functionality resides in ma
sub-folder instead of app folder which can now be used for app specific
customisation
Merge branch 'code-restructure'