Refactor story class

The Story class was difficult to test. This initial commit refactors
the simple components to make them more testable and to reuse code.