Autocorrect

Still a work in progress. Needs tweaking before merging. Still needs a settings UI, too.