Reorganized and added initial support for parsing function declarations.