Auto complete and other fixes

Along with syntax highlighting and other cleanup. Fixes #244 and #211
can't do anything about it...