Made history keeping optional. Added more tests. Added Apache license and setup.py