Extract JS stuff into own class

Add some extra integration (which appears to be
quicker than the unit tests)
use a more up to date minitest