Add token test and improve javascript.