Task

- Migrated util.cpp encode and decode functions because this is the only place
  they are used.