[ADD] Core, Locking: Command tests, fixups and locking XQuery option