Composer spec, slight doc updates
Fixed query correctness after code clean-up.
cleaned-up comments and re-ordered methods