Refactor utilities, add javadoc comments, create base command class.