Anything that is put into memory is run through json stringify and then back through json parse.  Instead of saving classes in memory you need to save the data to initialize them.