Multiple updates: added special character escaping, added support for co...

...mmas in values. removed possible index out of bounds errors, cleaned up code.

I was using these files for my own project and had to implement a few improvements. thought i would share