WIP begins refactor of leap.js