Remove trailing whitespace.
Add ability to pass custom transforms.