Fix incorrect merge and add test case for session with existing params
Change all isinstance(..., dict) calls to isinstance(..., collecitons.Mapping) to allow for CaseInsensitiveDict.