Fix #406.

Creates a espaceRegExp function in utils.
Adds tests for root option.