The stability of coplanar three-body systems with application to the solar system