Actually this is @andrewtennison's javascript code - I'm still desperately attempting to learn it myself! I'll ask him if he plans to decouple and test it.

Do we have good examples of decoupled testable JS that I could look at so that I'm learning the "best practice"? It would be very useful.