Remove curb dependency + tidy up code

Hey,

I started this as a small modification to remove some unneeded dependencies. These dependencies (read: curb) needed to be compiled, which was causing some issues for me.

In the end, I cleaned up some of the code as well.

Feel free to merge, or I can keep using my fork in my project.