Clean up code for CP Layout javascript #3275

This PR is 90+% code formatting or comments

The other % is removing [code that wasn't suppose to be in 3.x](https://github.com/openscholar/openscholar/commit/6b3fbca488e66a8859db199bad1fd0d44897ad5e#L0R123)