Did two TODOs in dungeon and gave some code their own functions.

Slightly more efficient dungeon generation after doing two TODOs. I believe everything works as before. I checked if everything works with prints and by making all tiles visible in the map (but obviously didn't include those code changes). Not the greatest testing method but I didn't know how else to do it.