Online Multitask Learning with Long-Term Memory