Add support for sorting parameters to Mapper.

Start adding support for sorting directions.
Refs #27
Separate out direction filtering.

Smaller methods are easier to read, also return the direction as part of
the pagination data. This will make generating links easier.

Refs #27
Add direction to endpoints.

Refs #27