Implemented database model for Plans and Event filtering.

Actions are up next.