Extract extend method to it's own file

* Extract extend method to it's own file
* Add unit tests
* Add test to see if we're in an environment with the JScript DontEnum bug before copying (own) toString method
* Refactor extend internals for better readability by using more variables
* Add [tomdoc](http://tomdoc.org) style documentation for extend method (experiment, I find them much easier to write and read)