Build and shim improvements

Hey Lindsay,

I saw all the improvements by @Oletus a few months ago that were incompatible with my fork, so I decided to do some refactoring off the latest stuff in the 3.1 branch. In particular I add a shim, .gitignore, package.json and fixed a bug with id clashing when you keep opening / closing scenes with the same id.