Change all the stdlib implementations to take OBTypeRefs

fix integer length issues and cast away spurious warnings.