Refactor lib/index.js to be thinner and cleaner.  Moved build command function into build.js