SQLite backend not storing literals properly

Literals were not being stored properly in the SQLite backend, resulting in e.g. language information being lost. This pull request adds a test showing the broken behavior and fixes it; note that the test still fails due a separate (unfixed) problem with statements being lost...