Here's a couple of comment cleanups, removal of unused code, and standardizing on Drupal style variables.
I just tested the one piece I was unsure of and it seemed to work...so, I committed this: http://drupal.org/cvs?commit=131555
Rather...this needs to be ported.
Automatically closed -- issue fixed for two weeks with no activity.
Drupal is a registered trademark of Dries Buytaert.