Dynamic API almost done. Reading is complete.

Still need to flesh out the writing part of the API. init functions
are making it very messy at the moment.