Refactor main application layer, slice application on module, create tests secret service, create utility functions and add template handling.