gl2: move conversion of types to a seperate file.