fix bug in getpass
refactor caching in models
batch related model selection
batch insert related models
move insert_dataset into separate file
fix double recording bug
several fixes, including case and length issues