more Profile work, including as_doc() implementation