Added provider handling methods + unit tests

PR #2 and #3 are also included in this PR.