Refactor renderElement and renderForm functions

Remove Control.Monad(void) dependency.
Reduce code duplication in renderForm.
Fix formatting.
Merge pull request #5 from crdueck/master

Refactor renderForm function