Added function that decides where to send data by reading host hame.
Also allows to change the destination by passing 'heroku' and 'local' as parameters.