add missing dependency on typelib
use endian-swapping code from typelib

It got copied there from utilmm so that we can finally get rid
of utilmm