use mysql api for deleting insecure users

- also some namespace tidy up
reverse test logic so it actually works