Fixed bugs with error reporting and various other things

Cleaned up comments
Added global CLI object (useful for debugging) and included in depends