COSMOS: A Hybrid N-Body/Hydrodynamics Code for Cosmological Problems