Add object type constants, remove magic numbers.