Hpit router test

Unit tests for the hpit router.  Fixed some bugs in the api, especially in the history and preview methods.