added --root-dir global option.
added basic smoke test.