Finished Code Rewrite

Finish code rewrite, pending review.

@JelloRanger: Looks like everything is good on my end, make sure that it compiles and works on your end, then merge the code in. Read the updated README so you don't get surprised.

Also, the code uses the Python Standard JSON Library. The dump function in the library leaves everything on one line. You might want to use