Move all public types to separate "lib" package

Moving the base types and also the http wrappers gives
the opportunity consumers to import the package and reuse the types.

* change the sort strategy creation