massive JS reorganization and clean-up
rename philologic.js to common.js