This was rewritten by Michael, switch copyrights to him and license to LGPL.