Refactored path and file handling so all directories are now accessed by URL ending with forward slash.