Some refactoring and only allow ndim >=2.
Update notebook.
gitignore core.
Enforce ndim == 2