Updated to match the latest version and documentation.

Updated to match the latest version and documentation.
Documentation is in jsDoc format to support intellisense.