Added unit tests for media blocks

Tests media block:
 - closing on split, rules are in part 1
 - opening on split, no rules in part 1
 - opening before split, rules in part 1 and 2

Tests extract_media separately as well