tests: move to mocha.
tests: stronger duck-type checking.
immutable rootpath.path.