Set subdevice id on saving.
Add uglified version of ninja.js