! Actually fix #2375 this time, and do some general code cleanup as well

This fixes the following issues:
- Fix #2375 this time (problem was a missing input tag which prevented the token details from being included)
- Re-arrange code so we don't have nested forms (it's not valid)
- Remove extraneous space from a div tag