Convert test plugin to integral part

By moving the test plugin, which could be considered and integral part
of Bob, even though it is a bit specific removes the need for including
its footer file for each read makerules.mk. For large projects this
removes a lot of syscalls like stat, open and read which are expensive
on slow (NFS) file systems.

=== Note
SECONDEXPANSION was required for the makefile code creating the tests so
to be consistent declaration of it was moved ahead of the functions
inclusion as well.