Begin convert to bytearray function and C package cleanup