Fix building tests.

Prior to this commit, test drivers weren't specifying the correct ldflags to
link properly.
Introduce 'runtests' subcommand.
Fix script to only run on python2