Bayesian Multitask Learning with Latent Hierarchies