The role of volcanism in the early history of the Moon and Mercury