Added load/save functions. Split into .h and .c files.