General cleanup and added an Application class