functions: Add common network functions.
functions: Replace inline templates with network functions.
Merge pull request #56 from sargon/network-functions

Network functions