verilator.py: Allow src_files in top-level core and use pyhon which

This fixes a bug where src_files were not allowed in the top-level
core. It also removes the need to call the external 'which' command
and instead uses a python implementation copied from twisted

Signed-off-by: Franck Jullien <franck.jullien@gmail.com>