Quantum and classical models for quadratic algebras associated with second order superintegrable systems