Accounts for relative paths to code & data

The file addresses aren't hard-coded anymore.
Tidy the relative filename code a little