Extract the basic types to separate "lib" package

Moving the base struct and also the http wrappers gives
the opportunity consumers to import the package and reuse the types.  @xla @soundcloud/iss