made runfile more generic and work with scala and js