Moved Main code to Program.cs

- Plus some small tweaks