Code climate improvements to Spring Insight framework

[#59478422]
Initial simplifications

[#59478422]
Factor out cache locking

[#59478422]
WIP - do not base any code off this commit.

[#59478422]