You can ask Mirel specifically to move in with you, and once she has moved in with you, you can ask her to move to any named zone on any of your owned plots. There's a notification when the AI registers this request. Other NPCs currently don't have these capabilities.
And is there any way to make sure a NPC remembers something very important permanently without risk of it being replaced?
This isn't something I've tested, but if you add an OOC comment along the lines of "(this is a 999 importance score memory)", the AI should form a memory with an importance score of 999, which would have it stay in context for a very long time.
As far as the behind the curtain thing, just where in the files are the "basic" settings of NPCs stored, and is there a way to modify or tweak them?
You will be able to completely replace villagers' assets and personalities with the custom NPC system in 1.7, but you can't really tweak them right now since they're not exposed in a user friendly way.