Move formatter stuff out of property parser function class

- some of the functionality is generic and may be useful in other parts of the code.
- todo: move stuff to ValueFormatters extension that is not Wikibase-specific

Change-Id: I9473ac43c3acbd87702eec63c6da3774b42053e4
Merge "Move formatter stuff out of property parser function class"