Add timestamps to unit add/remove & base classes for xml metadata generation

I think this should actually follow the same logic as the ``manager.update_unit_count`` call above. It should only be updated if the unit didn't already exist. Also, if being called from ``associate_all_by_ids``, it's fine to let that function do one update at the end instead of doing a unique update for each unit.