Replace references to document with references to this.ownDocument.
Fix jshint reported issues.
 Added error reporting in Pageable test page.