Added ability to save and load inventories.

Signed-off-by: Lucas Arnström <lucasarnstrom@gmail.com>