Fix several bugs in parseArguments and add test suite

The old code will fail these tests:

Expected: $data["funny"] === "spam=eggs"
Old result: isset($data["funny"]) === false

Expected: $data["s"] === "override"
Old result: $data["s"] === true

Expected: $data["key2"] === true && $data["b"] === true
Old result: $data["key2"] === "-b" && isset($data["b"]) === false