Organize and fix a few bugs
Modify path_to to support arbitrary length paths
Fix everything
Change tabs to spaces
Merging mcef's changes