Make serialization swappable

This makes it so BERT serialization can potentially be swapped out with something else.