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