Rewrote path handling, added config file support, comments, and some cleanup

Hey

+ I rewrote how the path handling algorithm works, a lot simpler now :)
+ Added mandatory configuration file at project basedir to enable the path algorithm
+ Some code cleanup and comments

Tom