Added in a bit of directory traversal support.
Not pretty but it seems to get the job done