create_app() function

Application factory, used to create application