Added some unit tests for Application. Also did some refactoring - moved rendering logic to Renderer object.