Documentation parsing. Some refactoring and code
improvements per Dmtiri's comments. // rdar://12379114