Split up receive function into recv-client and recv-server
Add some basic tests
Add simple commit test