Fix for #180 and #1059

Each time a module is created, it is checked to make sure that the name isn't already being used.