Using simple requirejs optimize function and adapt tests to it.