Added support for function declarations

Uses the method detailed in the TODO file. Tested on classes and it seems to work.

Also a fix for non-jsdocs comment blocks before a function causing confusion for the parser.