added support for collections

in the process, improved documentation and refactored internals

not sure how to handle grid columns given the conditionals, that might
get a bit messy