Origin of Inertia: Extended Mach's Principle and Cosmological Consequences