Added template engine, also mouse events now work correctly