Start to implement saving

also renamed Types.h