basic css parser, and factor out common code between css/html parsers into 'parser' module