Convert types to bytes

This makes it easier to deal with things internally as now
everything is passed as bytes.