consolidate docs/metrics building to remove duplication

I refactored some stuff to obviate the separate metrics building script as well as some of the duplicated session methods. Now everything is done by build_docs.py and there is a single session.store method that can handle both types of record. Please merge and do some manual testing to confirm I didn't break something.