Intercategories I: The basic theory