Fixed package file resolution. Fixes #718, #720.
Merge pull request #723 from pluma/npm-default-package-main

Default package "main" to "index". Fixes #719.