Rewrite the story editor using AngularJS for easier maintainability

Prepare architecture to implement #25.

Closes gh-35. Closes gh-17.