Implemented commands interface. Also added app exit codes