move encoding/decoding stuff to a subdirectory