refactored client into own namespace; added tests for core and client;