Added support for max assertion age with tests, alongside some minor clean-up.

@slobak could you take a look to validate that this is kosher? I've done a look through of everything myself.