prepare for for grouping @ rules than @media
python implementation
update c implementation to follow python implementation
add tests
add case test