Factor out parsing of various types of rules.
Add @media and media type parsing (no Media Queries yet.)