Move keymaster.js to lib