import some of the bug database; moved tests

The directory structure for tests is such that every test-case
is in its own directory, along with its reference output and
build rules.
add some testcases to "make check"
add more tests
add makefiles to .gitignore
build tests before running them
remove the diff code from makefiles
move new tests out of their subdirectories