Fix template method to check arg length to determine getter/setter.

If you call myLayout.template(undefined) it should treat this as an assignment,
not a get.

cc https://github.com/EventedMind/iron-router/pull/607.
Add test for setting undefined layout.