make metadata storage pluggable

we should also make the derby console output configurable instead of throwing its output away, especially for debugging.