fix toxic argument handling

This change abandons the use of ```strtok()``` and ```strchr()``` altogether in favor of manual parsing. String literals should now be handled correctly.