Generalise hacking dir path discovery

With a little tweak, `env-setup` may now be sourced from within the hacking directory, and paths will still be set accordingly.