Separating the new parser code for programs from SDF and returning the

grammar object in order to avoid having a static state.

@dwightguth please review.