Add package.json, change code to work with current dependency APIs.