Add support of jade template engine + export function to tools.js