initial import
a few cleanups to get closer to an approved flask extension