Autotools: sync with changes

This adds some of the extra goodies of the recent structure refactoring
into autotools. This is done by means of a Perl script which generates
the proper targets and file lists.

Also fixed in this commit is the removal of the CouchbaseMock.jar and
the googletest files from the `make clean` target. This avoids
unnecessary re-downloading of these resources (CCBC-101)

Change-Id: I682b7bfe33b5bc004e2051681a3bc2cd56fb719e
Reviewed-on: http://review.couchbase.org/36228
Reviewed-by: Brett Lawson <brett19@gmail.com>
Tested-by: Mark Nunberg <mnunberg@haskalah.org>