added the chapter editor control to the prototype

The chapter editor control needs refactoring! Use JavaScript OOP model
to make the code tidier and easier to maintain.