Moved all parser functions into parser.c
Consistenly named some types.