Fix INI parser

Fix the INI parser (issue #123). If you don't like this implementation, there are two others in my repo. This one is (IMO) the most readable, and the most modifiable. There is another one that is faster (premature optimization, yada yada), and one that minimizes the changes to the source, but still behaves in slightly odd (but not "wrong") ways.

The diff for this is on top of the diff for my previous pull request (about `"\\n"`).

I apologize for the size of the patch-set.  One of the commits included is just cleaning up a few string manipulation functions, since I was staring at string manipulation anyway.