Fixed debugger warnings, divided code in files, improved CLI.