Implemented decode! Added test files too.

- Bug in decode where last byte cannot be read