Rewrite a bit of entry controller so that
it'd be more testable.

refs #80
Add unit tests for EntryController

refs #80