WIP, bring changes over from improvements made by FreeRunning Technologies.

This is a wip pull request

Some differences: I've plucked out anything mentioning an expiration date. The tests pass. However I still need to go through and clean things up as some code is still reminiscent of the expiration dates. Comments as I go for review is always appreciated.