Added a unit test for mlrest.js; removed extra level of promise from getDocument ($http.get returns a promise already)
Added tests for rewriting search result metadata and pageLength