St Johnstone can avoid relegation this season after victory over Hearts who face a battle to seal third spot, according to Craig Moore.