Fixed base visitor, cleaned up tests and made test more robust, minor cleanup

BUG=

Review URL: https://chromiumcodereview.appspot.com//12310139