Extracted low-level API. Need to clean up the rest away, and define our own templates.~