I've been poking around with it an have managed to get this far:
http://rafb.net/paste/results/fKFsP371.html
I'm particularly confused at the last part. The tables are spread out as I have shown in above posts, so that would mean I'd need to write to a few separate tables, correct? Or, is it all done in this one table named jos_vm_category:
http://rafb.net/paste/results/EiYcTR44.html