There's a threading library on the forums.
You can do functions in types. A sub is just the same.
Hashmaps are a bit complicated, because GLBasic has no real template programming features. DDgui, however, has a string+to-string hash map that you can copy/paste to your projects.