Restructures JavaScript

Makes assets tied to an action in a controller, and sets up the details
view this way.