Raise malloc error should all else fail.
Add docs.
Rename params for consistency with docs.
Prepare for gh-pages.