Fix problems with merging vim.Dictionary

Also add tests

Fixes #516