Move html code from directives to templates.

For Issue #162