Parts of this commit are from a patch by sebasjm. The circular imports
caused an issue with webpack. While we don't use webpack in the wallet,
the wallet should still be importable by webpack.
Some packages were importing their dependencies via "index.js", which
re-exports public exports of the package. This resulted in circular
dependencies which were resolved correctly by rollup, but not by
webpack.