added data persistence with nscoding protocol

Still need to add persistence for the images