composite representations

import realm needs to be able to support composites.
Had to reorganize some of the json representations to suport composites too.