Many fixes, and make collocation use ajax calls to update results