Removed some unused code.
Put the render function with the rest of the functions.
Implemented cache, solves #6.