added missing consts to record save functions
added save stage for globals
forgot to write record ID
implemented saving for all supported record types except cells, referencables and references