Clone of psi46export for bare module tests. Based on SVN version 107.