Testing

Added unit, functional and integration tests