Move all history fns into own ns + define API.