Finished a saveComponent function for internal use.

There is still a lot to be done before this is functional, but the bones are now in place to add a component to the database.