Automatic Derivation of Memoryless Policies and Finite-State Controllers Using Classical Planners