Defined term() functions.

* Some required some proper memory cleanup.
* Fixed typo in README.