Extensive synchronization review

Went through all the uses of "synchronized" within core and made sure
that we only synchronize on mutable objects and, if we do, we
synchronize 100 %.