pid_store: initial release

DO NOT MERGE! (mainly because I haven't tested it)

Could you please take a look and agree or disagree with it.