Various improvements to make the code more useful to other developers:

- Added documentation
- fixed the connection pooling to take the server into consideration