Added unit tests, fixed page.js dep