1. Address review comments.
2. Change the format of layout definition from js to json.