MechJeb already has all this information - it's used for Transfer to now. Please expose whatever is already collected to us and tell us what units they're in; we can do the rest of the math ourselves.
Some way to select another object is of course required - a minimum would be "Mun", "Minmus", and "Kerbin". Better would also include some way of referencing other vessels and/or debris, be it typing something in, or selecting on the map screen or whatever else.