First draft of functional spec

The Document document is ready for comments.