Put form elements in their own template files.

Also added support to create neural network when leaving BUILD tab.