Using map to generate commands for work queue in a more generic was refs #12
rewrote SQL query to fit changes to map usage
added types to enum