beef up ctypes implementation, add fbt decorator