Convert tabs to spaces
Clean up main.js a bit