version 3 major rewrite, ported to addon sdk, incomplete