resolve and escape paths for CLI

This fixes issue #4