Reference abstract domains and applications to string analysis