Added the ErrorHandler() function to the Core controller to handle all error messages.
Added a 'Production' variable so I can toggle Error handling between development and Production environments.
Added a linebreak at the beginning of the returned error message for better formatting.
Updated SaveQuestion() functions in Data Model and Controller to use the new ErrorHandler() function from core controller.
Fixed Type in Data Controller.
Updated Data Controller & Model to use the new ErrorHandler() Function from the Core controller.
Changed all database errortypes to 'danger' in Data Controller.
Updated ErrorHandler() function in Core Controller so that if no Error object is sent it it returns the Production message (so I don't have to retype it for custom errors).
Updated Document Controller & Model and Views to use the new Error Handler except for the OpenPage() and HasPage() functions in Document Controller.
Fixed Variable Scopes in Core Controller.
Fixed Variable Scopes in Data Controller.
Fixed Variable Scopes in Document Controller.
Fixed Variable Scopes in Pages Controller.
Fixed Variable Scopes in Parts Controller.
Fixed Variable Scopes in Permissions Controller.
Fixed Variable Scopes in Progress Controller.
Fixed Variable Scopes in Questions Controller.
Fixed Variable Schopes in Schools Controller.
Fixed Variable Scopes in Sections Controller.
Fixed Variable Scopes in Tables Controller.