test: refactored tests for repositories to be smaller. Added test helpers.
Renamed server -> api
Moved signing code to api package.