Change hook to fire AJAX callbacks

Move AJAX callbacks in line before the capsule_gatekeeper() function hits. Avoids errors adding a capsule server to a local capsule environment.
Merge pull request #8 from ericandrewlewis/dev-1

Change hook to fire AJAX callbacks fixes #7