More careful whitespace handling. Use test where match not needed.
More power to state.