Implemented Parse Flags

This branch does introduce 3 more failing testcases, but they are not related to the features implemented in the branch. I will fix that error once this is merged in.