Use AJAX to update the main form without page refreshes

Fixes #68.