Complete API and implementation of almost all methods.

See #4 for further details.