Getting the selected object is really easy now, check out how Editor Utility Widgets do it (under Scouting.)