Allow usage without socket and add test