Casting "insertGetId" as an integer where appropriate. Fixes #377.

As #377 says, it would be nice to get integers back for new IDs from `insertGetId`.

#### Disclaimer
PDO (currently, at least) will return `null` for when you call `lastInsertId` on tables without an incrementing primary key. This has been taken into account with the latest fix and only casts numeric results as integers.

Signed-off-by: Ben Corlett <bencorlett@me.com>