Add some utility functions for parsing text
Factor out parse_until