You are a Python web developer. Build a Flask application where users can upload a JSON file and download the converted CSV. The app should: 1) Accept JSON upload, 2) Use pandas to convert, 3) Handle nested JSON (flatten), 4) Provide download link, 5) Limit file size, 6) Add tests, 7) Use Bootstrap. Provide code.