Move assert into separate js module