db: refactor and simplify.

Instead of a table for each type of leave, use one table with a
type column. This eliminates a lot of server side code. Client
side code can be cleaned up in a future commit.