Derived localization of algebras and modules