some optimizations, some cleanup, finally fix word boundaries so that all caps separated with underscores complete properly