Adding mapping support
Replaced __toString in BaseComponent with toJSON(), need to update children classes to call parent::toJSON()