refactoring mostly done: moved methods in main.js to crystalview.js. created main() method in main.js. simplify index.html to one call to main() method