Added support for subdirectories by implementing getBaseUrl() from ZF

I didn't want to set up a new virtualhost / domain to get the API working, but all links seemed to disregard my subdirectory root.

This branch introduces getBaseUrl() from Zend Framework and includes the resolved path in the base for the request, allowing for some.domain/joindin-api/v2.1/* etc.

Tested on both subdirectory and root path and both seem to work fine.