move functions to Tools.cs; adds a few more commands