[ticket/416] Move database handling of moving modules vertically to handler

B3P-416