Proof-of-concept implementation of SM handling

Created a few IQ patterns responsible for maintaining the internal SM
representation.