Update chapter.md

- Added walkthrough of 500 lines, updated introduction
- Add images for chapter
- Move function declarations out of the constructor of non-singleton
  objects and into the object's prototype.