Systematically identifying ultracompact binaries and other short-period variables in wide field time domain surveys