The app now builds the script string to insert. Grabs the keys from the db and added queries to the save functions to save the keys to the database.