Fix issue of seed being ignored if equal to 0

Previously, in pretty much all random topology generators a user
provided seed equal to 0 was ignored. This was caused by the seed
being set only if the condition `if seed` was met. If seed was set
to 0, this condition was not met. This commit changes all `if seed`
with the more explicit `if seed is not None` to correct this issue.

This commit also adds test cases to prevent the reappearance of this
issue in future.