Add language detection. Documentation. Cleanups.