Add NullApp to prevent nil checks and update unit tests.
Add helper method for current database.
Refactor application controller to use NullApp and clean up runtime error handling.
Remove redundant modal assignment.
Remove deprecated code.