Huge commit

Javascript fixes, mobile CSS merge in progress.