Thats the right mindset!
What I can recommend for version control is github, perhaps you've heard of it? There are also other softwares and services out there of course, though my team and I are comfortable with github (gitkraken to be specific). As for modular coding, I can't give a lot of feedback for I don't code a lot myself! I hope the internet can help you further.