Refactored code to find modules for testing slightly

The find command is invoked at build time and not configure time.