ENH Parse \immediate

This also generalises the previous flags for parsing macros. Now, there
are two flags: \global & \immediate; but it is easier to add new ones.
ENH Parse \write command