Calculate formula weight and percent of each element for a given formula