Move privilege functions to commands.lua
Add support for nested commands and quoted arguments