Added basic toJson and toString functions to components.