fix docs and formatting and minor refactoring from PR #313. small improvements to lazily applying layout attributes to cells. close #306. close #281.