Take a look at the following threads here on this site:
http://community.wolfram.com/groups/-/m/t/214901
http://community.wolfram.com/groups/-/m/t/242583
What you want to create is a Package.