Added public, protected, and private modifiers.

Parsing of function definitions in namespaces was also added.