Refactor UI code (plus API message style)

1. Move NDT UI code into a separate file.

2. Refactor API messages from backend to
frontend. The new messages are of the form
<test>.message so that the UI code can register
handlers depending on the type of test.
Add optional boundaries for fetching test results.