Major refactoring of documentation and some fixes in parsing comments