Improved base path handling.
Fixed jshint warning.
Merge pull request #59 from nearform/better-paths

Improved base path handling.