move bookkeeping code below main code in polymer-element, factor prototype generation out of polymer-element and into it's own 'api' module