Adding tests and abstracting transport

Test cases, test cases everywhere! Also, since you never know, I abstracted the transport layer, so you could potentially add more implementations and endpoints.