added getContextRoot() method to lib.js