Several test cleanups and minor test fixes
The CLI was completely rewrote. Changed dependency from yargs to commanderjs, which is cleaner, faster and has no dependencies. Also added a complete testsuite for the cli. Merged branch 'cli_refactor' into develop Closes #893, #894