break core out into separate files; use grunt for building