Fixes #7, adds test coverage and make app settings lazy.