Precision determination of heavy quark masses and the strong coupling constant