alphagov/whitehall — pull request #1785 by tekin (2014-10-16 13:10:47+00:00)
Title: Fix namespacing issues (and a bit of tidy up)

We get occasional "uninitialized constant" exceptions thrown in sidekiq workers because they cannot load certain namespaced classes (see [exception 1](https://errbit.production.alphagov.co.uk/apps/53020d6c0da11585f10000e7/problems/543cdf2d0da115a6930005fa), [exception 2](https://errbit.production.alphagov.co.uk/apps/53020d6c0da11585f10000e7/problems/5436b9660da11598590012c2), and [exception 3](https://errbit.production.alphagov.co.uk/apps/53020d6c0da11585f10000e7/problems/5436b9660da115cbfe001088)). These changes make the loading of those namespaced classes explicit, either by requiring them where they are needed or by using Rails `autoload` to define the dependency (see http://urbanautomaton.com/blog/2013/08/27/rails-autoloading-hell/ for more details about constant lookup and Rails autoload).

The final commit tidies up some code I came across that is either unused, or unnecessarily abstracted to a module when it is only used in one place.