[WIP] Add basic tests and rewrite getsockopt