added jade templating support; refactored DB into singleton object; renamed a few things