Tests are now async
Extracting some util functions into its own file