Rework options parsing to use grunt's built-in options parsing, remove some dead code, add test.