Improvement in tests - can now run automatically

Still only smoke test level testing, but a start. Would be better using
an actual test framework too.