Add @document support

Closes #4.