Javascript library for waiting on multiple functions