As far as I know villagers can move next to the river, as long as there's 1 grid tile of space between. You also need to make sure that if you have any pwp's, there needs to be a space of 2 between the pwp and house. This also goes for every other structure.