Revert "Revert "add 'safe submodule; change internal lists to vectors""

This reverts commit c6f16dead468926996a690299136b3e621904e69.