Change import order. Refs #9353

The unit test fails otherwise with some very cryptic message if no matplotlib is present