Add more exhaustive tests for .asTypeOf

This includes changing AsTypeOfSpec to be FunSpec instead of FlatSpec
so that the tests can have more structure.
in 0 seconds and was queued for 81 minutes and 52 seconds