Added submodule support

This adds submodule support issue #6. I squashed my commits and rebased off latest master.