Make use of WP_Theme

And take care of #338 in the process.