Add 'then' command to call javascript functions.
Merge pull request #23 from hugoruscitti/master

Add 'then' command to call javascript functions.