Minor improvements, mostly to activity-details.js

Stuff I've had floating around for a while.
* Simplifies some functions in activity-details.js and adds updateFields method.
* Sorts some of the duplication in activity-details.js
* Fixes other very minor issues in Java