api-ify the structure module -- needs LOTS of testing now, as I'm sure I
forgot something simple...