added tests ...FINALLY
various refactoring
lots of work. added bootstrap.