refactored touchstone.js; cleaned up lint errors