Making changes for case sensitive file system.

Sorry there are a bunch of commits here, had to do some tweaking along the way.