Templating (ejs-locals), server file style.

Made templating work, rearranged server file to keep difference between database stuff and server stuff.
Concatenation more idiomatic in node.