Documentation and Where extraction

Lot's of documentation in `document.rb`. Pulled the where code into its own module.