parse: refactor to make `greedy` and `raise` keyword arguments.

This makes the `parse` function more composable and self-documenting.