Add encode module with simple encoding functions