Fix scanning root.
Move errors out of main
Fix bug in time machine logic
Use logging output for errors, instead of stdout.
Fix a couple of path handling bugs.