Improve documentation and contribution guidelines

Include documentation on the trim() polyfill and extend documentation
on other functions.
Include a note on coding conventions.
The check to see if the given variable is a valid element can be
massively simplified.