Add layout invalidation

Adds the ability to invalidate the layout. This is different from reloading the data, which involves the data source.

I'm not entirely happy with the way this is set up right now. Currently it needs to remove all subviews from the document view and lay it out again. When we want to start supporting animations this won't work at all. This is something to look into in the future.