removed JS redundancies; fixed some JSLint errors

hat tip to Joseph Silber for the redundancy alert.