Added missing lifetime annotations, doc and whitespace cleanups