Remove inline require, add tests