Unifying Microscopic and Continuum Treatments of van der Waals and Casimir Interactions