Expose hash and fingerprint function for user customization.

Hi,

I have worked with the connect code a bit to do my thing: customize the hash and session id generation functions. This pull request is to propose these changes to the official project, since other users might like it.

I can do what I want now, and it seems to be working perfectly. 

There was also an issue where some clients do not send a user-agent, instead of using an empty string my code uses the ip address + port as a second attempt, before resorting to the empty string.

I don't know if you will like my inlining of function declarations though.