Implement template render, move stuff out of lib