Added implementation of set encoding
Added tests for set encoding
Fixed test failures