validate container loader fn argument and error if invalid

This is a small thing, but it's really mysterious later on when a non-function is passed in :)