Switched to all character fields, fixed the tests, refactored into generic map and filter functions.