Removed TODO: comment
Updated JavaDoc, checks for null, renamed permission field.
Added support for Result data type to for JavaScript functions.