Move common put, delete, forEach.
Move migrations to its own JS file.