cleaned up decode.js functions and provided additional documentation for functions
Merge branch 'master'