[JS] Rework empty table function

Start cleaning up some of the promise usages to a classical callback model for better WInJS vs JS support & readibility.