Add abstratcted cross-domain GETs and POSTs via CORS

Closes #54. Cleanup and changes for API consistency compared to the original pull request, plus extra jsdoc and some edge cases handled in fallback behaviour.