Move code to bause.js, add make rules