Yay, no fussing with edit mode. Thanks to _FrnchFrgg_ in #blendercoders for the tip.
There is no error checking, texture alignment or support for non-point lights, but it's a start. Also, it's assumed all brushes are convex and manifold.