Check leaks while testing
Pull js unspecific code to util to also use in css module