Add additional safety checks and file types.

Added a check to see if the path exists before using it, added new file types, expanded array for readability, made file types and working directory appear more constant.
Merge pull request #1 from austinkelleher/master

Add additional safety checks and file types.