More refactoring. Foreground part was split up to frontend class and foreground scripts
IDE was switched to VS2010. Further code cleaning and improving.