[ticket/216] Remove duplicate code from moving modules in acp and add tests

Fixes #216