Hierarchical Finite State Controllers for Generalized Planning