template: clean up whitespace

Convert tabs into spaces, add some comments and fix some indentation

Signed-off-by: Ferry Huberts <ferry.huberts@pelagic.nl>
template: re-arrange targets

To be in a more logical order

Signed-off-by: Ferry Huberts <ferry.huberts@pelagic.nl>