refactor core.js from index.js

separate functionality from CLI
pull issues params out
add labels options