Added more tests, refactor decodeSlice
More cleanups