Make function signatures more precise

- also use utils.map in few places more
Merge pull request #32 from phadej/more-signatures

Make function signatures more precise