Event filtering and params extension for Primus

This pull request implements #50 for Primus and extracts common Socket provider functionality (setting up event handlers and methods).