Pluggable object persistence in Scala