Make filterString accept a throwonerror argument and add basic tests for the command line interface.