Remove unused code and reduce JSHint warnings

Change-Id: I2d71df4e9b252bbe4139be3afdf65ce076b21f49
Merge "Remove unused code and reduce JSHint warnings"