Organised and cleaned up imports
Added full persistence support.