Support running inside an application server.
Merge pull request #8 from jsyrjala/app-server-support

Support running inside an application server.