Add in model saving and automatic primary key population

Signed-off-by: David Fisher-Moreau <deiform87@gmail.com>