Adds encoder and decoder tests, pass with Jasmine