renames and cleanup
Piles are now KvMap, a key-value map