move most history parsing into the history library

Also start stubbing out tests.