Added compatibility for pickle

I saw not every platform has cPickle available so I added this try-except for pickle.