Christina/fix asset index

On AWS, JavaScript is pipelined in such a way that JavaScript defined in base.js is not defined in other files that do not also go through the pipelining.

Following a practice that we have already had, assigned $modal and hideModal to the window object.

@chrisndodge @jkarni Please review. Unfortunately I don't have a good way to test if there are any other issues until we push to staging.