Add an event for document contents changes
yet more autocomplete WIP