implemented all the main formatting options for #180. Still a bit of simplifying / more work to be done, so this API may break before we ship v1.1.