init of safely.
catch
fix bug and add test.
add a TODO.
based on cr
Merge pull request #368 from xianxu/develop

Allow timeout of a user function