Moved these formatters and filters into TegraZone core.

Were too custom for inclusion in the REST API module.
Refactored sorting to be simpler code.