added general-use insert function into Database lib and refactored user_model to use it