Improve source code readability and consistency

It includes:
- fix lots of whitespace issues,
- normalize HTML and JSON views,
- display extra information in account pages.