Snippets and extensible completion support. Code still messy, but it
seems to work.