Major improvements to JSON code, import classes now.