rewrote script to use sqlite and mako templating. improved UI.