Use indexOf and substr instead of split on '='

Stops breaking when there is an '=' in the value of the kv pair.