Adds support for build archs to run command
 + small cleanup and refactoring
 + fix jshint issues