Fixes #9: rename toJson to toString and encapsulate fields in model objects