Dortmund displayed a second-half masterclass to secure victory in Bremen and stay three points behind Bayern.