add support for configurable whitespace checking algorithms and default it to the simplest one. resolves #484