Allow @extend within media queries

Adding the ability to use `@extend` within a media query. Will extend anything within the same media query as well as outside the scope. Might close #902, except I am not sure if that pull request expects the behaviour of extending outside the media query.