Upgrade for entity framework 6

Upgrade for entity framework 6, updated deprecated code etc.

Also added .bat for easy building