WIP begins refactoring leap.js