Phase separation and charge density waves: Possible sources of non-Fermi liquid behavior and pairing in high-temperature superconductors