[ticket/416] Move database code for moving modules horizontally to handler

B3P-416