From Sturm-Liouville problems to fractional and anomalous diffusions