Move injectables into functions

So stuff isn't executed at import time.
Merge pull request #2 from synthicity/functionize

Move injectables into functions