I wrote this a while ago. I think a complete refactor and update of code would be good. Refine the API and maybe make the code faster.