fix layerToObject bug, jshint warnings, and update build