Add support for timeout in function kwargs

I've added support for passing the timeout in kwargs, which means the client
code can decide the timeout. This is useful for functions that take a timeout
argument.

I've also made the tests proper and added nosetests as a requirement.

I'm not 100% sure about the implementation, so your feedback is appreciated.