Java code refactoring

Moving encoder/decoder in dedicated codec packages (like js
implementation)