Add docs and misc tidy up