Duration functions

Two duration functions for Utils to help APs with tracking attempt duration. 

Once this looks good i can re-do this as a single commit to avoid the multiple whitespace fix fix commits..

Note: this also includes a commit from here: https://github.com/RusticiSoftware/TinCanJS/pull/88 just because I didn't want to spend ages in git trying to remove it and that PR looks good to merge anyways.