Fixed tests and continued refactoring of commands. Closes #81