add ssl in production
added some extra tests and cleaned up application view code