reduce some code duplication
Add appletSettings.js to makefile, add json writer
Update base applet classes to store their appletId (instance ID)