Significant updates. Added events to synchronize layer model and to serialize JSON to hidden input field, etc.