refactoring: split javascript into system and programs