Transfer some code from grunt-bemstylus task