Item factory uses catajson, has better error messages

Made the item factory use catajson so that we have less code duplication. Also made item loading use debugmsg (in cases where that didn't automatically happen thanks to catajson).

Cleaned up some item definition errors that were revealed when we switched to debugmsg.