Add generic JS error handling

API errors should now come in a generic fashion, whether they're triggered by MW
core code, or Flow-specific.
If an API request fails, the returned error will automatically be displayed in
the nearest form, in a red/pink error box.

Change-Id: Ib4e22abeb3ae6128825528153c0ad8fa3d9aaa7c