Moved app to an application factory create_app(). Changed all files to reflect this. Also started work on FrontendTests in all the applications