Lots more work on the html

- Reformatted long tags for readability
- Improved error handling and display