Finished and fixed API

Hopefully I rewrote all the stuff that I lost. There are no tests yet.
This is like an...intermediate step to ensure I don't lose stuff again.