Added beginnings of pattern save support