Refactor models and node_api

A couple of long lines here too.