[GP,LA] Finish database, refactor file access