Merge pull request #21 from draganglumac/master

Templates table now linked to jobs table.
Merge pull request #22 from draganglumac/master

Making device type id nullable in templates table.