Fixing minor things, and first version of layout.js