broke out magic lamp js so application js can be in charge of initialization