added API docs.

As mentioned in email...

i used the comment style used by the license block. If you prefer doxygen style or some other, just let me know.

Happy Hacking!