Extracted some duplication into formatting context and a link helper
Documented newly extracted objects
Merge pull request #3 from loz/master

Cleanup of some code smells raised by code climate