added get_or_initialize class function, cleaned up js formatting, added test for mastery.