Minimal implementation of query execution + some metadata

Still buggy.