Merge pull request #59 from ledgersmb/master

sync over master branch
Merge pull request #63 from ledgersmb/master

sync over master branch
Factor query into prepared parameterized statement and better input check.
(grafted from daa274149925633fb4451bce518231c0efccf894)

--HG--
extra : source : daa274149925633fb4451bce518231c0efccf894
Merge pull request #283 from ehuelsmann/master

Improve inventory imports