Fix support for rails engines/plugins

See here for a description of the problem:

https://github.com/rails/spring/issues/144#issuecomment-31994648

The solution is to make the application_id depend on the *project* root
rather than the *application* root, since only the server can know the
correct application root.