Node.js: Abstraction for different client types