Major api revamp. Most of the code's been touched.