Major refactoring, converted application to CLI only.