Factor out test utils
Add history library