Rename x2sql.js to main.js
Updated js reference
Using new name, fixed some small bugs