added callback for timeout
improved coding style
changed to proper error object usage for throwing timeout error
Merge pull request #91 from stefanjudis/master

Callback at timeout