Moved extension registration and blueprint registration into their own functions and created an error handling function, all called from create_app