Added requirejs support
Added public function 'getTotalPages'
Updated indention in source