add name attribute to player directive so name will persist after reset, and cleaned code